/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package model;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Entity;
import javax.persistence.Inheritance.*;
/**
 *
 * @author Marvin Hiemstra
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="Gebruiker")
public class Gebruiker implements Serializable{
    

    //@OneToOne(cascade = {CascadeType.ALL})
    @Id
    @GeneratedValue
    @Column(name = "uCode")
    private String uCode;
    @Column(name = "firstName")
    private String firstName;
        @Column(name = "lastName")
    private String lastName;
    @Column(name = "insertion")
    private String insertion;
    @Column(name = "email")
    private String email;
    @Column(name = "password")
    private String password;
//    @OneToMany(cascade = CascadeType.ALL)
//    @JoinTable(name = "USER_FILE", joinColumns = { @JoinColumn(name = "uCode") }, inverseJoinColumns = { @JoinColumn(name = "FILE_ID") })
//    private Set<File> studentPhoneNumbers = new HashSet<File>(0);
    

    public Gebruiker() {
    }

    public Gebruiker(String uCode, String email, String firstName, String insertion, String lastName, String password) {
        this.uCode = uCode;
        this.firstName = firstName;
        this.lastName = lastName;
        this.insertion = insertion;
        this.email = email;
        this.password = password;
    }

        

//    public Set<File> getStudentPhoneNumbers() {
//        return studentPhoneNumbers;
//    }
//
//    public void setStudentPhoneNumbers(Set<File> studentPhoneNumbers) {
//        this.studentPhoneNumbers = studentPhoneNumbers;
//    }
    
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getInsertion() {
        return insertion;
    }

    public void setInsertion(String insertion) {
        this.insertion = insertion;
    }

    public String getLastName() {
        return lastName;
    }
    public String getName() {
        if(insertion!=null){
            return firstName+" "+insertion+" "+lastName;
        }else{
            return firstName+" "+lastName;
        }
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    
    public String getuCode() {
        return uCode;
    }

    /*public Set<User> getUser() {
        return user;
    }

    public void setUser(Set<User> user) {
        this.user = user;
    }*/
    

}
